<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<!-- 头部导航栏 -->
<jsp:include page="../header.jsp"></jsp:include>
<title>===标题===</title>
<script type="text/javascript">
$(document).ready(function() {
	//提交表单验证
	$("#data_form").submit(function () {
		var pass = true;
				
		//组织名称合法性验证
		var orgName = $("#id_orgName").val();
		if(!orgName) {
			$("#im_orgName").html("请输入合法的组织名称！").show();pass = false;
		}else if(orgName.length>20) {
			$("#im_orgName").html("组织名称不能超过20个字符！").show();pass = false;
		}else {
			$("#im_orgName").hide();
		}
		
		//地区合法性验证
		var zone = $("#id_zone").val();
		if(zone && zone.length>20) {
			$("#im_zone").html("地区不能超过20个字符！").show();pass = false;
		}else {
			$("#im_zone").hide();
		}
		
		//电话号码合法性验证
		var telphone = $("#id_telphone").val();
		if(telphone && telphone.length>20) {
			$("#im_telphone").html("电话号码不能超过20个字符！").show();pass = false;
		}else {
			$("#im_telphone").hide();
		}
		
		//地址合法性验证
		var address = $("#id_address").val();
		if(address && address.length>20) {
			$("#im_address").html("地址不能超过20个字符！").show();pass = false;
		}else {
			$("#im_address").hide();
		}
		
		//描述信息合法性验证
		var description = $("#id_description").val();
		if(description && description.length>20) {
			$("#im_description").html("描述信息不能超过20个字符！").show();pass = false;
		}else {
			$("#im_description").hide();
		}
		
		return pass;
	});
});
</script>
</head>
<body>
	<div class="container dz-main">
		<!--标题和按钮组===begin===-->
		<div class="dz-head">
			<div class="dz-title">管理</div>
			<div class="dz-head-btns">
				<a class="btn btn-success btn-sm" href="<%=request.getContextPath()%>/security/organization/index.do">返回</a>
			</div>
		</div>
		<!--标题和按钮组===end===-->
		<!--表单数据===begin===-->
		<form id="data_form" class="form-horizontal" action="<%=request.getContextPath()%>/security/organization/save.do" method="post">
			<div>
				<input type="hidden" name="orgId" value="${obj.orgId}"/>
			</div>
			<div class="form-group">
				<label for="id_orgName" class="col-xs-2 control-label"><span class="dz-flag">*</span>组织名称</label>
				<div class="col-xs-6">
					<input id="id_orgName" type="text" class="form-control" name="orgName" value="${obj.orgName}"/>
				</div>
				<div id="im_orgName" class="col-xs-4 dz-info"></div>
			</div>
			<div class="form-group">
				<label for="id_zone" class="col-xs-2 control-label">地区</label>
				<div class="col-xs-6">
					<input id="id_zone" type="text" class="form-control" name="zone" value="${obj.zone}"/>
				</div>
				<div id="im_zone" class="col-xs-4 dz-info"></div>
			</div>
			<div class="form-group">
				<label for="id_telphone" class="col-xs-2 control-label">电话号码</label>
				<div class="col-xs-6">
					<input id="id_telphone" type="text" class="form-control" name="telphone" value="${obj.telphone}"/>
				</div>
				<div id="im_telphone" class="col-xs-4 dz-info"></div>
			</div>
			<div class="form-group">
				<label for="id_address" class="col-xs-2 control-label">地址</label>
				<div class="col-xs-6">
					<input id="id_address" type="text" class="form-control" name="address" value="${obj.address}"/>
				</div>
				<div id="im_address" class="col-xs-4 dz-info"></div>
			</div>
			<div class="form-group">
				<label for="id_description" class="col-xs-2 control-label">描述信息</label>
				<div class="col-xs-6">
					<textarea id="id_description" class="form-control" name="description" cols="3">${obj.description}</textarea>
				</div>
				<div id="im_description" class="col-xs-4 dz-info"></div>
			</div>
			<div class="dz-submit-b">
				<button type="submit" class="btn btn-primary">保存</button>
			</div>
		</form>
		<!--表单数据===end===-->
	</div>
</body>
</html>